const { loginHandler , rpwdHandler , regHandler } = require('../controller/user');
const { testLogin , testRpwd , testToken , testReg } = require('../middleware/users');

const router = require('express').Router() ;

// 登陆  post   username   password
router.post('/login' , testLogin ,  loginHandler) ;

// 修改密码  post  id  token  password  newPwd
router.post('/rpwd' , testRpwd , testToken , rpwdHandler) ;

// 注册
router.post('/reg' , testReg  , regHandler) ;

module.exports = router ;